package org.springblade.modules.repair.dto;

import cn.hutool.core.util.ObjectUtil;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.models.auth.In;
import lombok.Data;
import org.springblade.core.tool.utils.Func;
import org.w3c.dom.stylesheets.LinkStyle;

import java.util.ArrayList;
import java.util.List;

/**
 * @Date 9:26 2022/4/26
 * @Description {
 *   电梯工单列表查询条件
 * }
 * @Author lsay
 **/
@Data
public class CheckPlanPageQueryDTO {

	private String userIds;

	private String startTime;

	private String endTime;

	private Integer typeStatus;

	private Long elevatorId;

	/**
	 * 任务状态 1-待开始 2-进行中 3-提交任务 4-签字完成
	 */
	private String planStatus;

	/**
	 * 及时性 1-及时 2-及时
	 */
	private String timeliness;

	/**
	 * 时长 1-过长 2-过短 3-正常
	 */
	private String duration;

	/**
	 * 签到签退 1-签到定位异常 2-签退定位异常 3-未签退 4-系统签退 5-正常
	 */
	private String sign;

	/**
	 * 电梯用途 0-公用，1-私用
	 */
	private Integer useType;

	/**
	 * 逾期状态 1-正常 2-逾期
	 */
	private String overdue;

	private String keyword;

	/**
	 * 项目id
	 */
	private Long buildingId;

	private List<Long> elevatorIds;

//	private List<Integer> planStatusList;
	private List<Integer> timelinessList;
	private List<Integer> durationList;
	private List<Integer> signList;
	private List<Integer> overdueList;
//
//	public void setPlanStatus(String planStatus) {
//		if(ObjectUtil.isNotEmpty(planStatus)){
//			this.planStatusList = Func.toIntList(planStatus);
//		}
//		this.planStatus = planStatus;
//	}
//
	public void setTimeliness(String timeliness) {
		if(ObjectUtil.isNotEmpty(timeliness)){
			this.timelinessList = Func.toIntList(timeliness);
		}
		this.timeliness = timeliness;
	}

	public void setDuration(String duration) {
		if(ObjectUtil.isNotEmpty(duration)){
			this.durationList = Func.toIntList(duration);
		}
		this.duration = duration;
	}

	public void setSign(String sign) {
		if(ObjectUtil.isNotEmpty(sign)){
			this.signList = Func.toIntList(sign);
		}
		this.sign = sign;
	}

	public void setOverdue(String overdue) {
		this.overdue = overdue;
		if(ObjectUtil.isNotEmpty(overdue)){
			this.overdueList = Func.toIntList(overdue);
		}
	}
}
